// PointPosition.h: interface for the PointPosition class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_POINTPOSITION_H__8072C3E0_268F_410B_9B93_F2AC1DC57629__INCLUDED_)
#define AFX_POINTPOSITION_H__8072C3E0_268F_410B_9B93_F2AC1DC57629__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "GNSSRinex.h"
#pragma warning(disable:4273)
using namespace std;
namespace NGSS{

class AFX_CLASS_EXPORT CaPosition  
{
public:
	CaPosition();
	CaPosition(RNXFILE*pRinex);
	~CaPosition();
	
	bool	Attach(RNXFILE*pRinex);
	RNXFILE*Detach(void);
	BOOL	ProcessEpochs ( CallBackProgress callBackProgr = NULL);
	char*	ProcessOneEpoch ( const long epochindex,const PGMOREC pRec, const PGMN pGMN );
	void	SetErrorhandler(int errorstrategy);
	int		GetErrorhandler(void);
	ostringstream&	GetErrorReport();
private:
	bool GetPreciseOrbNclk(const PGMN pGMN,const PGMOREC pRec,
							const int PRNIndex,CRDCARTESIAN CrdRev,const double delta_tRev,
							double &delta_tSat,CRDCARTESIAN&CrdSat,double&Range);
	void	reporterror(const char* szErrorMsg);
private:
	enum exceptionOp{ ignore = 0, abort, retry};
	CaRinexData	m_Rinex;
	
	int			epochfailed;
	int			errorhandler;
	ostringstream m_errormsg;
};

}
#endif // !defined(AFX_POINTPOSITION_H__8072C3E0_268F_410B_9B93_F2AC1DC57629__INCLUDED_)
